package com.eastfair.questionnaire.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;

import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 答案
 * </p>
 *
 * @author yuwx
 * @since 2021-08-18
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "AnswerVO", description = "答案")
@AllArgsConstructor
public class AnswerVO extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;

    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")

    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 问题id
     */
    @ApiModelProperty(value = "问题id")

    @Excel(name = "问题id")
    private Long questionId;

    /**
     * 下一题id
     */
    @ApiModelProperty(value = "下一题id")

    @Excel(name = "下一题id")
    private Long nextQuestionId;

    /**
     * 上级答案
     */
    @ApiModelProperty(value = "上级答案")

    @Excel(name = "上级答案")
    private Long parentAnswerId;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")

    @Excel(name = "排序")
    private Integer sequence;

    /**
     * 问题名称
     */
    @ApiModelProperty(value = "问题名称")
    @Size(max = 128, message = "问题名称长度不能超过128")

    @Excel(name = "问题名称")
    private String name;

    /**
     * 问题英文名称
     */
    @ApiModelProperty(value = "问题英文名称")
    @Size(max = 128, message = "问题英文名称长度不能超过128")

    @Excel(name = "问题英文名称")
    private String enName;

    /**
     * 问题别名
     */
    @ApiModelProperty(value = "问题别名")
    @Size(max = 128, message = "问题别名长度不能超过128")

    @Excel(name = "问题别名")
    private String aliasName;

    /**
     * 问题英文别名
     */
    @ApiModelProperty(value = "问题英文别名")
    @Size(max = 128, message = "问题英文别名长度不能超过128")

    @Excel(name = "问题英文别名")
    private String enAliasName;

    /**
     * 提示语
     */
    @ApiModelProperty(value = "提示语")
    @Size(max = 128, message = "提示语长度不能超过128")

    @Excel(name = "提示语")
    private String defaultTip;

    /**
     * 图标地址
     */
    @ApiModelProperty(value = "图标地址")
    @Size(max = 255, message = "图标地址长度不能超过255")
    @TableField(value = "icon_url", condition = LIKE)
    @Excel(name = "图标地址")
    private String iconUrl;

    /**
     * 末级节点
     */
    @ApiModelProperty(value = "末级节点")

    @Excel(name = "末级节点", replace = {"是_true", "否_false", "_null"})
    private Integer isLeaf;

    /**
     * 允许输入
     */
    @ApiModelProperty(value = "允许输入")

    @Excel(name = "允许输入", replace = {"是_true", "否_false", "_null"})
    private Integer isInput;

    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")

    @Excel(name = "是否生效(默认1：可用 0:不可用)", replace = {"是_true", "否_false", "_null"})
    private Integer isEnabled;

    /**
     * 是否选中(1：选中 0:未选中)
     */
    @ApiModelProperty(value = "是否选中(1：选中 0:未选中)")
    @Excel(name = "是否选中(1：选中 0:未选中)", replace = {"是_true", "否_false", "_null"})
    private Integer isSelected;

    /**
     * 填空题输入结果
     */
    @ApiModelProperty(value = "填空题输入结果")
    @Size(max = 128, message = "填空题输入结果长度不能超过128")
    @Excel(name = "填空题输入结果")
    private String inputResult;

    /**
     * 是否删除(默认0：未删除 1:已删除)
     */
    @ApiModelProperty(value = "下级答案")

    @Excel(name = "下级答案")
    private List<AnswerVO> subAnswerList;


}
